updating oE temp_file

temp_file

include filesys.e 
namespace filesys 
public function temp_file(sequence temp_location = "", sequence temp_prefix = "", 
        sequence temp_extn = "_T_", integer reserve_temp = 0) 

returns a file name that can be used as a temporary file.

Parameters:
  1. temp_location : A sequence. A directory where the temporary file is expected to be created.
    • If omitted (the default) the 'temporary' directory will be used. The temporary directory is defined in the "TEMP" environment symbol, or failing that the "TMP" symbol and failing that "C:\TEMP\" is used on Windows systems and "/tmp/" is used on Unix systems.
    • If temp_location was supplied,
      • If it is an existing file, that file's directory is used.
      • If it is an existing directory, it is used.
      • If it doesn't exist, the directory name portion is used.
  2. temp_prefix : A sequence: The is prepended to the start of the generated file name. The default is "" .
  3. temp_extn : A sequence: The is a file extention used in the generated file. The default is "_T_" .
  4. reserve_temp : An integer: If not zero an empty file is created using the generated name. The default is not to reserve (create) the file.
Returns:

A sequence, A generated file name.

Example 1:
temp_file("/usr/space", "myapp", "tmp") --> /usr/space/myapp736321.tmp 
temp_file() --> /tmp/277382._T_ 
temp_file("/users/me/abc.exw") --> /users/me/992831._T_ 
Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu